-
Notifications
You must be signed in to change notification settings - Fork 1
Add Symfony 8.0 support #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Fixes "Passing an array of options to configure the \"FOS\\RestBundle\\Validator\\Constraints\\Regex\" constraint is deprecated, use named arguments instead."
Support php <8.0
…x/test-mime-type Fix MimeTypeTest for Symfony 7.4
…ted-methods Don't use deprecated `#[Route]` methods
…x-validator-constructor-fix FIx usage of Regex validator constructor
…deprecations Fix deprecations from symfony/validator
Using xml is deprecated in symfony 7.4
Use php instead of xml for service configuration
Add support for symfony v8
Test against PHP 8.5
Fix badges in readme
# Conflicts: # Tests/EventListener/MimeTypeListenerTest.php
Summary of ChangesHello @nikola-jovanovic-php, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly updates the FOSRestBundle to ensure full compatibility and support for Symfony 8.0 and PHP 8.5. It integrates recent upstream changes, resolves numerous deprecation warnings, and adapts the codebase to changes in Symfony's API, particularly concerning request handling, validator constraints, and PHP's reflection API. The primary goal is to modernize the bundle and maintain its functionality with the latest versions of Symfony. Highlights
Ignored Files
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request adds support for Symfony 8.0 by updating dependencies and fixing various deprecations. The changes are well-implemented and cover compatibility with symfony/validator and PHP 8.1+. I've found a minor issue in one of the test files where the updated assertions for File and Image constraints use an incorrect constructor signature. I've provided suggestions to fix this. Overall, this is a great update.
| $this->param->requirements = ['mimeTypes' => 'application/json']; | ||
| $this->assertEquals([ | ||
| new File($requirements), | ||
| new File(null, null, null, 'application/json'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The constructor for Symfony\Component\Validator\Constraints\File has changed in newer Symfony versions. The current instantiation new File(null, null, null, 'application/json') is incorrect as it passes the mime type as the 4th argument, which corresponds to mimeTypesMessage. It should be the 3rd argument (mimeTypes).
new File(null, null, 'application/json'),| $this->assertEquals([ | ||
| new NotNull(), | ||
| new Image($requirements), | ||
| new Image(null, null, null, ['image/*']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $this->assertEquals([new All([ | ||
| new NotNull(), | ||
| new Image($requirements), | ||
| new Image(null, null, null, ['image/*']), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| $this->assertEquals([new All([ | ||
| new NotNull(), | ||
| new File($requirements), | ||
| new File(null, null, null, 'application/pdf'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Summary
This adds full Symfony 8.0 support including:
^8.0tosymfony/configrequirementRequest::get()methodReferences